package ynu.edu.entity;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单实体类
 */
@Entity
@Table(name = "orders")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderEntity implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 订单ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer orderId;
    
    /**
     * 用户ID
     */
    private String userId;
    
    /**
     * 商家ID
     */
    private Integer businessId;
    
    /**
     * 订单日期
     */
    private LocalDateTime orderDate;
    
    /**
     * 订单总金额
     */
    private BigDecimal orderTotal;
    
    /**
     * 订单状态：0-待支付，1-已取消，2-已支付，3-配送中，4-已完成
     */
    private Integer orderState;
    
    /**
     * 送货地址ID
     */
    private Integer daId;
} 